package com.activemq.springtest.listener;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * 消费监听 bean
 */
public class TextMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message) {
        if(message instanceof TextMessage){
            try {
                String text=((TextMessage)message).getText();
                System.out.println("spring监听接收消息"+text);
            } catch (JMSException e) {
                e.printStackTrace();
            }
        }
    }
}
